<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: nannan
  Date: 2021/6/10
  Time: 19:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的购物车</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/shopCart.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/tubiao.css">
</head>
<body>
<!-- start header -->
<!--end header -->

<!-- start banner_x -->
<div class="banner_x center">
    <a href="index.jsp" target="_blank"><div class="logo fl"></div></a>

    <div class="wdgwc fl ml40">我的购物车</div>
    <div class="dlzc fr">
        <ul>
            <ul>
                <li><a href="${pageContext.request.contextPath}/mvc/toUpdate.do"><i id="userIcon" class="iconfont" style="color:black;">&#xe669;</i> ${sessionScope.user.name}</a></li>
                <li>|</li>
                <li><a href="${pageContext.request.contextPath}/mvc/logout.do"><i id="logoutIcon" class="iconfont" style="color: red;">&#xe605;</i></a></li>
            </ul>
        </ul>

    </div>
    <div class="clear"></div>
</div>
<div class="xiantiao"></div>

<%--购物车具体界面--%>
<div id="div01">
    <table>
        <tr style="font-weight: bold">
            <td>商品图片</td>
            <td>商品名称</td>
            <td>单价</td>
            <td>数量</td>
            <td>小计</td>
            <td>操作</td>
        </tr>

        <c:forEach items="${requestScope.shopCarts}" var="item">
            <tr>
                <td><img src="${pageContext.request.contextPath}/${item.product.cartimages}"></td>
                <td><strong>${item.product.name}</strong> <br>【${item.product.company}】</td>
                <td>$ ${item.product.baseprice}</td>
                <td><a href="${pageContext.request.contextPath}/mvc/subAmount.do?productid=${item.product.id}&amount=${item.amount}" title="数量减一"><i id="isub" class="iconfont" style="color: black">&#xe6b6;</i></a>${item.amount}<a href="${pageContext.request.contextPath}/mvc/addAmount.do?productid=${item.product.id}&amount=${item.amount}" title="数量加一"><i id="iadd" class="iconfont" style="color:black;">&#xe608;</i></a></td>
                <td>$ ${item.amount*item.product.baseprice}</td>
                <td><a id="deleteIcon" href="${pageContext.request.contextPath}/mvc/deleteById.do?productid=${item.product.id}" style="text-decoration: none;font-size: 25px" title="删除">×</a></td>
            </tr>

        </c:forEach>

    </table>


    <div id="div02">
        <div id="div05"><span style="color:#FF6700;font-weight: bold">共${requestScope.count}件商品</span></div>
         <div id="div04"><span style="color:#FF6700;font-weight: bold">合计：$ ${requestScope.total}</span><div id="div03"><a href="${pageContext.request.contextPath}/mvc/toOrder.do">结算</a></div><div id="div06">
             <a href="${pageContext.request.contextPath}/mvc/clearCart.do">清除</a></div></div>
    </div>
</div>





<%--购物车具体界面--%>
<!-- footer -->
<footer>
    <div class="copyright">简体 | 繁体 | English | 常见问题</div>
    <div class="copyright">罗德岛制药公司版权所有-罗ICP备111451419-<img src="image/ghs.png" alt="">罗公网安备1145141919810号-罗ICP证114514号</div>
</footer>


</body>

</html>
